/**
 * Description:
 * Class Name:GenericMethodTest
 * Date:2022/3/25 13:46
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第9章_泛型._9_4_泛型方法._9_4_1_定义泛型方法;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class GenericMethodTest {
    static void fromArrayToCollection(Object[] a, Collection<Object> c){
        for(var o: a){ c.add(o);}
    }

    public static void main(String[] args) {
        List<Object> x = new ArrayList<>();
        Integer[] ss = new Integer[]{1,2};
        fromArrayToCollection(ss, x);
        System.out.println(x);
    }
}
